<?php $control= Yii::app()->getController()->getId();?>
<style type="text/css">
	.accordion-inner li{
		list-style:none;
		margin: 10px 0;
	}
	.accordion-inner li a.btn{
		width: 80%;
		text-align:left; 
	}
</style>
<div class="widget widget-accordion">
					<div class="widget-header">
						<h3>
							<i class="icon-sitemap"></i> User Manager
						</h3>					
					</div> <!-- /.widget-header -->
					<div class="widget-content">
						<div class="accordion" id="sample-accordion">
							<?php if(Yii::app()->user->role=='superadmin' || Yii::app()->user->role=='admin'):?>
				            <div class="accordion-group">
				              <div class="accordion-heading">
				                <a class="accordion-toggle" data-toggle="collapse" data-parent="#sample-accordion" href="#collapseUser">
				                 <i class="icon-user"></i>  Users
				                </a>
				                <i class="icon-plus toggle-icon"></i>
				              </div>
				              <div id="collapseUser" class="accordion-body <?php echo  $control=='users'?'in':''?> collapse">
				                <div class="accordion-inner">
				                  <ul>
				                		<li>
				                			<?php echo CHtml::link('<i class="icon-plus"></i> Create User',array('/users/create'),array('class'=>'btn')); ?>
				                		</li>
				                		<li>
				                			<?php echo CHtml::link('<i class="icon-th-list"></i> List Users',array('/users/admin'),array('class'=>'btn')); ?>
				                		</li>
				                	</ul>
				                </div>
				              </div>
				            </div>
				            <?php endif;?>
				            <div class="accordion-group">
				              <div class="accordion-heading">
				                <a class="accordion-toggle" data-toggle="collapse" data-parent="#sample-accordion" href="#collapseMy">
				                <i class="icon-lock"></i>  My Account
				                </a>
				                <i class="icon-plus toggle-icon"></i>
				              </div>
				              <div id="collapseMy" class="accordion-body <?php echo Yii::app()->user->role=='manager'?'in':'';?> collapse">
				                <div class="accordion-inner">
				                	<ul>
				                		<li>
				                			<?php echo CHtml::link('<i class="icon-key"></i> Account Info',array('/users/update','id'=>Yii::app()->user->id),array('class'=>'btn')); ?>
				                		</li>
				                		<li>
				                			<?php echo CHtml::link('<i class="icon-signout"></i> Logout',array('/site/logout'),array('class'=>'btn')); ?>
				                		</li>
				                		<li>
				                			<?php echo CHtml::link('<i class="icon-external-link"></i> View Page',Yii::app()->request->baseUrl,array('class'=>'btn','target'=>'_blank')); ?>
				                		</li>
				                	</ul>
				                </div>
				              </div>
				            </div>
				          </div>					
					</div> <!-- /.widget-content -->
</div> <!-- /.widget -->